package com.itheima.collection.traversal;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author Anomaly
 * @date 2022/12/31 20:52
 */
public class LambdaDemo {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();

        collection.add("China");
        collection.add("USA");
        collection.add("JAP");
//        collection.forEach(new Consumer<String>() {
//            @Override
//            public void accept(String s) {
//                System.out.println("s: " + s);
//            }
//        });

//        collection.forEach(s -> System.out.println(s));

        collection.forEach(System.out::println);

    }
}
